1. Field of the Invention
The present invention relates to a storage controller and a storage device failure detection method.
2. Description of the Related Art
A storage controller provides a host computer with redundant storage areas based on RAID (Redundant Array of Inexpensive Disks). Therefore, even if a failure should occur in one of the storage devices, parity data can be used to recover the data.
Furthermore, to enhance data protection reliability, technology for adding a guarantee code to data and storing the guarantee code-appended data in a storage device is known (Japanese Patent Laid-open Nos. 2004-288078, 2006-164319 and 2001-338468). For example, a combination of a LA (Logical Address) and LRC (Longitudinal Redundancy Check) is used as the guarantee code. The logical address is a logical block address, which a host computer specifies as the access target. The LRC is a value determined for carrying out an exclusive OR operation for a logical block of data.
The guarantee code is made correspondent to the data and stored in a storage device. When the data is read out from the storage device, the guarantee code is read out together with the data, and the guarantee code is checked. Consequently, it is possible to determine whether or not the data was read out from the correct location, and also whether or not there was a change in data bits that were read out.
However, an abnormality or the mechanical vibration of the control circuit inside the storage device can result in the updating of data in a location other than the location that is supposed to be updated. For example, in the case of a device, such as a hard disk device, in which old data is overwritten with new data, a write-error failure occurs when old data cannot be overwritten with new data in a target location.
Since the target location is not updated with new data, the data read out from this target location is still the old data. However, the guarantee code added to this old data only guarantees that this old data was read out from the original location, and that the bits have not changed. Therefore, when old data is read out from a location, which should have been updated, there is no means of checking if this data is new data, and it is not possible to detect that updating of the old data failed. This is called a write-error failure in this specification.
Conversely, in the case of a device, such as a flash memory device, which updates address mapping such that new data is written to a page other than the page in which the old data is stored, and the page to which the new data was written becomes the valid page, there is the danger of a read-error failure occurring. When old data is mistakenly read out from the page on which the old data is written when the intention was to read out the new data, this error cannot be detected.
Accordingly, in a second prior art (Japanese Patent Laid-open No. 2006-164319), historical information, which is updated in line with the updating of data to be stored in a first sector, is respectively added to the relevant data and the data to be stored in a second sector, and the historical information added to the data stored in the first sector is collated against the historical information added to the data stored in the second sector. Consequently, the second prior art verifies the data, which is stored in the first sector.
The prior art verifies whether or not stored data is correct by respectively storing historical information in the first sector and the second sector. However, the restoration of data in which an error is detected is not considered.